package com.hoshiibuy.fileServer.model;

import java.io.Serializable;

import com.hoshiibuy.fileServer.result.Result;
import com.hoshiibuy.fileServer.result.ResultStatus;

import lombok.Data;
@Data
public class UploadFileRepsonse implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String fileName;
	
	private String url;
	
	private String objectKey;
	
	private ResultStatus status=new ResultStatus();;
	
    public UploadFileRepsonse(int code, String message){
        status.setCode(code);
        status.setMessage(message);
    }
    
    public UploadFileRepsonse(ResultStatus status) {
    	this.setStatus(status);
    }
	
    public ResultStatus getStatus() {
		return status;
	}
	public void setStatus(ResultStatus status) {
		this.status = status;
	}

	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public boolean isSuccess(){
        return this.getStatus().getCode() == Result.SUCCESS_CODE;
    }

	public String getObjectKey() {
		return objectKey;
	}

	public void setObjectKey(String objectKey) {
		this.objectKey = objectKey;
	}
	

}
